<?php
    header("content-type:text/html;charset=utf8");
    $conn=new Mysqli("localhost","root","root","db_bailian");
    Mysqli_set_charset($conn,'utf8');
   
    if($conn->connect_errno){
        die("数据库连接失败！");
    }
        $sql1="select * from t_addcart";
        $res1=$conn->query($sql1);
        while($row=Mysqli_fetch_assoc($res1)){
            $arr[]=$row;
        }
        $result=json_encode($arr);
        echo $result;
?>
